/*************************************************************************
	> File Name: P1147.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2024-12-20 15:35:48
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 2000000

int sum[MAX_N + 5];

int main() {
    int m;
    cin >> m;
    for (int i = 1; i <= m; i++) {
        sum[i] = i + sum[i - 1];
    }
    int left = 1, right = 2;
    while (left <= m / 2) {
        int val = sum[right] - sum[left - 1];
        if (val == m) {
            cout << left << " " << right << endl;
            left++, right--;
        } else if (val < m) {
            right++;
        } else {
            left++;
        }
    }
    return 0;
}
